<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layuiAdmin 网站用户 iframe 框</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/Font-Awesome-master/css/font-awesome.min.css">
    <script src="/js/jquery-2.1.1.min.js"></script>
    <script src="/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
    <style>
        html{
            background-color: #fff;
        }
        .bb_div{
            padding:30px;
        }
        .table_th{
            margin-bottom: 20px;
        }
        table{
            font-size: 12px;
        }
        table td{
            min-width: 150px;
        }
        .table{
            border:1px solid #000;
            border-radius: 10px;
            padding:15px;
            float: left;
            margin: 0 20px 20px 0;
        }
        .table_jw{
            line-height: 50px;
        }
        .table_fg{
            line-height: 40px;
        }
    </style>
</head>
<body>
<div>
    <div style="margin: 30px;">
        <button type="button" class="layui-btn layui-btn-primary" lay-href="{:url('read')}?id={$id}">基本信息</button>
        <button type="button" class="layui-btn layui-btn-primary" lay-href="{:url('jb')}?id={$id}">剧本</button>
        <button type="button" class="layui-btn layui-btn-normal">财务报表</button>
    </div>
    <div class="bb_div">
        <div>
            {foreach $data as $k=>$v}
            <div class="table">
                <div class="table_th"><h3>{$v.year}年{$v.month}月财务报表</h3></div>
                <table>
                    <tr>
                        <td>收入：{$v.income}元</td>
                        <td>支出：{$v.expenditure}元</td>
                    </tr>
                    <tr>
                        <td>同比上月{if $v.income_status == 1}增长{else}下降{/if}&nbsp{$v.income_percentage}%</td>
                        <td>同比上月{if $v.expenditure_status == 1}增长{else}下降{/if}&nbsp{$v.expenditure_percentage}%</td>
                    </tr>
                    <tr class="table_fg">
                        <td>收入项</td>
                        <td></td>
                    </tr>
                    {foreach $v.business_report_detailed as $kk=>$vv}
                    {if $vv.business_money_type.type == 1}
                    <tr>
                        <td>{$vv.business_money_type.name}：{$vv.money}元</td>
                        <td>同比上月{if $vv.status == 1}上升{else}下降{/if}&nbsp{$vv.fd}%</td>
                    </tr>
                    {/if}
                    {/foreach}
                    <tr class="table_fg">
                        <td>支出项</td>
                        <td></td>
                    </tr>
                    {foreach $v.business_report_detailed as $kk=>$vv}
                    {if $vv.business_money_type.type == 2}
                    <tr>
                        <td>{$vv.business_money_type.name}：{$vv.money}元</td>
                        <td>同比上月{if $vv.status == 1}上升{else}下降{/if}&nbsp{$vv.fd}%</td>
                    </tr>
                    {/if}
                    {/foreach}
                    <tr class="table_jw">
                        <td>结算 +{$v.money}元</td>
                        <td>同比上月{if $v.money_status == 1}增长{else}减少{/if}&nbsp{$v.money_percentage}%</td>
                    </tr>
                </table>
            </div>
            {/foreach}
        </div>
    </div>
</div>

<script>

    layui.config({
        base: '/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload','layer'], function () {
        var $ = layui.$
            , form = layui.form
            , upload = layui.upload;

        //自定义验证
        form.verify({
            nickname: function(value, item){ //value：表单的值、item：表单的DOM对象
                if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
                    return '用户名不能有特殊字符';
                }
                if(/(^\_)|(\__)|(\_+$)/.test(value)){
                    return '用户名首尾不能出现下划线\'_\'';
                }
                if(/^\d+\d+\d$/.test(value)){
                    return '用户名不能全为数字';
                }
            }
            ,fd_number:[/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,'只支持2位小数的数字']
            ,pass: [
                /^[\S]{6,12}$/
                ,'密码必须6到12位，且不能出现空格'
            ]

            //确认密码
            ,repass: function(value){
                if(value !== $('#LAY_password').val()){
                    return '两次密码输入不一致';
                }
            }
        });
        $('body').on('keyup', '.icon_search_input', function(){
            var keyword  = $.trim($(this).val());
            if (!keyword) {
                $(this).closest('.icon_select_options').find('li').show();
            } else {
                $(this).closest('.icon_select_options').find('li').each(function(){
                    var className = $(this).find('i').attr('class');
                    if (className.indexOf(keyword) >=0) {
                        $(this).show()
                    } else {
                        $(this).hide()
                    }
                })
            }
        })

    })
</script>
</body>
</html>